<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>扩展运算符应用</title>
</head>

<body>
    <div></div>
    <div></div>
    <div></div>
    <script>
        //1. 数组的合并
        // const kuaizi = ['王太利','肖央'];
        // const fenghuang = ['曾毅','玲花'];

        //使用concat合并数组
        //const zuixuanxiaopingguo = kuaizi.concat(fenghuang);

        //使用扩展运算符合并数组
        // const zuixuanxiaopingguo = [...kuaizi, ...fenghuang];

        //2. 数组的克隆
        // const sanzhihua = ['E','G','M'];
        // const sanyecao = [...sanzhihua];//  ['E','G','M']
        // 如果数组里包含引用数据类型，则为浅拷贝

        //3. 将伪数组转为真正的数组
        const divs = document.querySelectorAll('div');
        const divArr = [...divs];
        console.log(divArr); // arguments
    </script>
</body>

</html>